Author: Pat Lynch

E.T.T.A.
Conference 2008

Using a Peripheral Interface
Controller (PIC)
in
Project Design

PIC (Peripheral Interface Controller)
A PIC is an IC which can be programmed from a computer to respond to one or more inputs and control one or more outputs, i.e. it can be compared to ‘a computer on a chip’.
The reason why it is often called a computer on a chip is that a PIC contains
ROM (Read Only Memory)
RAM (Random Access Memory)
I / O (Input / Output)
CPU (Central Processing Unit)
Examples of PIC Applications: -
Household appliances - Washing machines / microwaves
Alarm systems
Medical equipment
Vehicle subsystems - engine management / remote locking
Traffic lights
Car barriers
Entertainment industry
Toys
Vending machines
Display units
Advantages of PICs :-
PICs can be repeatedly programmed and reprogrammed
Increased reliability due to less circuitry requirements
Rapid product changes can be made by changing the program and not the electronic hardware
Greater product flexibility and adaptability
Provides a platform to support the development of simple to complex solutions i.e. What If ?

Control Software
There are various software programs that can be used to program PICs. As a teaching resource T4 commissioned the manufacture of a special PCB board for use by school implementing the Technology syllabus. These boards were made available for the round 4 technology development sessions. The t4 board uses the PIXAXE chip and has five on board inputs and eight outputs. The software used to program the PIXAXE 18X chip on the board is called PIC LOGICATOR. Using the Logicator software the PIC can be programmed to control the various inputs and outputs.
T4 PICAXE 18X Training Board (5 inputs, 8 outputs)

Inputs	Outputs
3 Analogue: - / LDR / Var. Resistor / Temp. Sensor / 2 Digital: - / 2 PTM Switches	8 LED outputs / 1 Piezo / 1 Seven segment / 2 External motors / 4 External outputs / 1 Stepper motor / 1 Server motor

PIC LOGICATOR Control Software
The software uses a flowchart to control the inputs and outputs.
A series of command boxes are available on the right of the screen and these are selected by clicking on them, holding down the mouse button and dragging them on to the work area.
To complete the program each block is linked by a connecting line to show the sequence of operation as shown.
The simple program shown opposite will carry out the following commands:
Turn on all the green LED’s on the t4 board. The green LED’s are connected to outputs number 0, 3 and 6 on the t4 board.
Leave the LED’s on for 2 seconds
Play a sound (note C3) for 2 seconds
Stop the program
A simulation of the program can be run on screen to check the for any errors.
When the program is ready it can be downloaded to the PIC chip using a USB cable. Note that the download icon is being selected in the screen shot shown opposite.
When the program is downloaded it will turn on the requested LED’s and play the sound.
The Program shown on page 6 will operate a traffic light sequence. This can be demonstrated on the t4 board using the eight LED’s. Note that the program will run continually.
The program on page 7 is used to automatically open a car barrier and close the barrier when the car has exited the barrier.

Traffic Lights
The LED’s are turned on using the OUTPUT command.
Example: The Amber LED’s are connected to outputs 1 and 4. To turn on these LED’s, double click on the OUTPUT box and set the required output to 1 as shown opposite. All other outputs are turned off (set to 0).

Car Barrier
This simple program containing just six blocks of instructions will open a car park barrier automatically when a vehicle drives up to the barrier. It will also close the barrier automatically when the car enters the car park.
The bar is opened and closed using a servo motor. The 1st servo command puts the barrier in the home position (closed). The 2nd Servo command opens the barrier vertically (slightly beyond 900).

T4—Technology Subjects Support Service
Galway Education Centre, Cluain Mhuire, Wellpark Galway
Phone: 091 – 745650 E-Mail: admin@t4.ie
Web Site: www.t4.ie

#

#